
%Compute Welfare growth along transition

%Consumption on BGP path

C_BGP=exp(g_plot(1).*(t_vector-1980));
C_path(1)=C_BGP(1);
for i=2:length(t_vector)
    g_entry(i)=trapz(t_vector(2)-t_vector(1),g_plot(360:360+i-1));
    C_path(i)=exp(g_entry(i));
end

W=exp(-p.rho.*(t_vector-1980)).*log(C_BGP);
W=trapz(t_vector(2)-t_vector(1),W);
W2=exp(-p.rho.*(t_vector-1980)).*log(C_path);
W2=trapz(t_vector(2)-t_vector(1),W2);


AdjustmentFactor=exp(p.rho*(W2-W));